package ch6;

import java.util.Scanner;

public class FindArray2 {

	public static void main(String[] args) {
		int[] ar = { 8, 4, 12, 56, 78, 133, 14, 23, 69 };
		Scanner in = new Scanner(System.in);
		System.out.println("请输入要查找的数：");
		int k = in.nextInt();

		for (int i = 0; i < ar.length; i++) {
			if (k == ar[i]) {
				System.out.println(k + "在数组中");
				break;
			}

			if (i == ar.length - 1) {
				System.out.println(k + "不在数组中");
			}
		}

	}

}
